home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / update / update.man < prev   
Encoding:
Text File  |  1992-03-09  |  7.2 KB  |  176 lines

  1. ' $Header: /sprite/src/cmds/update/RCS/update.man,v 1.2 92/03/08 22:42:54 mottsmth Exp $ SPRITE (Berkeley)
  2. .so \*(]ltmac.sprite
  3. .HS UPDATE cmds
  4. .BS
  5. .SH NAME
  6. update \- A copy program that recursively updates directory trees
  7. .SH SYNOPSIS
  8. \fBupdate\fR [\fIoptions\fR] \fIsrc1 ... srcN targetDir\fR
  9. .br
  10. \fBupdate\fR [\fIoptions\fR] \fIsrc target\fR
  11. .SH OPTIONS
  12. .IP "\fB\-b \fIdirectory\fR" 15
  13. Before updating a target, save a backup copy of the file in
  14. \fIdirectory\fR.
  15. .IP "\fB\-B \fIdays\fR" 15
  16. Only save the target as a backup copy if no backup exists or if the
  17. target is \fIdays\fR days old.  
  18. .IP "\fB\-f\fR" 15
  19. Force:  always update targets regardless of last-modified times.
  20. .IP "\fB\-g \fIgroup\fR" 15
  21. Change the group of any updated files to \fIgroup\fR.  Targets that aren't
  22. updated do not have their groups changed.
  23. .IP "\fB\-help\fR" 15
  24. Print a summary of the command-line options and exit without updating
  25. any targets.
  26. .IP "\fB\-l\fR" 15
  27. If a source file is a symbolic link then \fBupdate\fR normally creates an
  28. identical symbolic link at the destination.  If the \fB\-l\fR switch
  29. is specified, then \fBupdate\fR copies the file referenced by the source link,
  30. rather than the link itself.
  31. .IP "\fB\-m \fImode\fR" 15
  32. When updating a target, set its protection bits to \fImode\fR.  Targets
  33. that aren't updated do not have their protection changed.  \fIMode\fR
  34. must be specified in octal.
  35. .IP "\fB\-n\fR" 15
  36. Be nice about problems with file types not matching (i.e. don't return
  37. an error).
  38. .IP "\fB\-M\fR" 15
  39. When updating a target, do it by moving the source instead of by
  40. copying.  This may be useful when disk space is tight.
  41. .IP "\fB\-o \fIowner\fR" 15
  42. Perform all updates as user \fIowner\fR, so that newly-created targets
  43. will be owned by \fIowner\fR.  Any targets that are not updated will
  44. not have their \fIowner\fR changed.
  45. .IP "\fB\-O\fR" 15
  46. This option preserves ownership on newly created files.  Only root or
  47. wheel group members can use this option.
  48. .VS
  49. .IP "\fB\-p \fIpruneExpr\fR" 15
  50. Prune subtress whose name matches the given regular expression.
  51. .VE
  52. .IP "\fB\-q\fR" 15
  53. Quiet.  Don't print anything except for error messages.  \fBUpdate\fR normally
  54. prints a message for each file copied.
  55. .IP "\fB\-s\fR" 15
  56. Strip.  Source files are all expected to be executable binaries.  When
  57. copying, strip all of the symbol and relocation information from the
  58. updated target.
  59. .IP "\fB\-t\fR" 15
  60. Instead of setting the last-accessed and last-modified times of each
  61. target to match those of its source, leave them alone, so that they are
  62. set to the current time.
  63. .IP "\fB\-v\fR" 15
  64. Verify.  Don't actually modify any files, but print information about
  65. which files would have been modified.
  66. .IP "\fB\-i\fR" 15
  67. Ignore symbolic links entirely.
  68. .BE
  69.  
  70. .SH INTRODUCTION
  71. .PP
  72. The \fBupdate\fR command is used to replace out-of-date copies of files with
  73. more recent versions.  It operates on one or more source files.  For
  74. each source, \fBupdate\fR locates a corresponding target;  if the target
  75. doesn't exist, or if the last-modified
  76. time of the source is later than the last-modified time
  77. of the target, or if the \fB\-f\fR option
  78. is specified, then \fBupdate\fR makes a copy of the source at the target.
  79. The target's last-modified time and permissions will be set identical
  80. to those of the source.
  81. .PP
  82. In the simplest case, two file names are given, both of which are
  83. regular files.  In this case the first file name is the source and
  84. the second is the target.  If the last file name refers to
  85. a directory, then all the other file names (of which there may be
  86. more than one) are sources.
  87. Each source file will be updated to the corresponding file
  88. \fIwithin\fR the target directory.  For example, in the command
  89. .DS
  90. \fBupdate /a/b c d foo\fR
  91. .DE
  92. the target for \fB/a/b\fR will be \fBfoo/b\fR, the target for \fBc\fR
  93. will be \fB/foo/c\fR, and the target for \fBd\fR will be \fBfoo/d\fR.
  94. .PP
  95. If any of the source files is a directory, then its entire subtree will
  96. be updated to the corresponding target, maintaining the subtree
  97. structure of the
  98. source.  In the special case where only two file names are given
  99. and both are directories, then the source is updated \fIto\fR
  100. the target directory rather than \fIwithin\fR it.  Thus, in the command
  101. .DS
  102. \fBupdate a b\fR
  103. .DE
  104. where \fBa\fR and \fBb\fR are both directories and
  105. \fBa\fR contains one subdirectory \fBc\fR which in turn
  106. contains one file \fBd\fR, the target corresponding
  107. to \fBa/c/d\fR will be \fBb/c/d\fR.  \fBUpdate\fR will create the
  108. directory \fBb/c\fR if it doesn't already exist.
  109. .PP
  110. \fBUpdate\fR will also copy symbolic links.  Normally it creates matching
  111. symbolic links at the targets, but it will copy the files pointed to
  112. by the links if the \fB\-l\fR switch is given.
  113. .PP
  114. If the target for a source already exists but has a type different from
  115. the source (e.g. the target is a directory and the source is a regular
  116. file), then \fBupdate\fR will not modify the target.  If the target's last-modified
  117. time is more recent than the source's, then again \fBupdate\fR will not modify
  118. the target.
  119.  
  120. .SH "USER AND GROUP CHANGES"
  121. .PP
  122. There are several restrictions on usage of the \fB\-O\fR, \fB\-o\fR and \fB\-g\fR
  123. switches.
  124. You may specify \fB\-O\fR only if you are root or in the wheel group.
  125. You may specify \fB\-g \fIgroup\fR as long as you are a member
  126. of \fIgroup\fR.
  127. You may specify \fB\-o \fIowner\fR if either
  128. .IP [1]
  129. You are \fIowner\fR (which isn't very interesting).
  130. .IP [2]
  131. \fIOwner\fR is \fBroot\fR, and you are a member of the \fBwheel\fR group.
  132. .IP [3]
  133. There is a group with the same name as \fIowner\fR and you are a member
  134. of that group.
  135.  
  136. .SH "SET-USER_ID"
  137. .PP
  138. If you haven't specified the \fB\-m\fR switch, then \fBupdate\fR attempts
  139. to preserve set-user-id bits.  It also attempts to preserve set-user-id
  140. bits when making backup copies, even if the \fB\-m\fR switch was given.
  141. However, set-user-id bits are not preserved unless the owner of the
  142. target file is the same as the owner of the source file (this condition
  143. is always true if the \fB\-O\fR switch is given).
  144.  
  145. .SH "BACKUP FILES"
  146. .PP
  147. If the \fB\-b\fR switch is specified, then \fBupdate\fR attempts to
  148. ensure that a backup copy of the target is saved, if the target
  149. already exists.  If a backup already exists, then the backup is
  150. overwritten only if the target is relatively old (a parameter that
  151. defaults to files two weeks old and may be overridden by the \fB-B\fR
  152. switch, specifying the requisite age in days).  If the \fB-B\fR switch
  153. specifies an age of 0, then the most 
  154. recent target will always be backed up.  Normally, the default of 14
  155. (two weeks) is used to guarantee that an unstable file does not
  156. overwrite a stable backup.
  157.  
  158. .VS
  159. .SH "PRUNING SUB-TREES"
  160. .PP
  161. The \fB\-p\fR option can be used to prune unwanted sub-trees from the source
  162. files. The argument is a regular expression that is matched against all source
  163. files before updating them.  If the expression matches then the source is
  164. not updated.  The expression is matched against only the tail of the source
  165. path name, so using an expression of "foo/bar" will not do what you think
  166. it will. If the argument contains any magic characters such as "*" then you
  167. better put it inside of quotes otherwise csh will glob it first.  Multiple
  168. \fB\-p\fR options can be specified and will be compared against the source files
  169. one at a time. 
  170. .VE
  171. .SH KEYWORDS
  172. copy, up-to-date
  173.  
  174. .SH "SEE ALSO"
  175. cp, mv, tar
  176.